<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>

<script type="text/javascript" src="<c:url value="/js/jquery.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/effects.js"/>"></script>

<html>
<head>


    <link rel="stylesheet" type="text/css" href="<c:url value="/css/style.css"/>">
</head>
<body>
<table align="center" border="0" cellspacing="0">
    <tr>
        <td>
            <%@include file="/WEB-INF/inc/header.jsp" %>
        </td>
    </tr>

    <tr bgcolor="#ffffff" height="800" align="center">
        <td style="padding: 40px">

            <table class="info">
                <tr>
                    <td>
                        <img height="150" src="<c:url value="/userimg/"/><c:out value="${info.imgurl}"/>" alt="">
                    </td>
                    <td>
                        <table>
                            <tr>

                                <td>
                                    <spring:message code="field.fname"/>
                                </td>
                                <td>
                                    <c:out value="${info.fname}"/>
                                </td>
                            </tr>
                            <tr>

                                <td>
                                    <spring:message code="field.sname"/>
                                </td>
                                <td>
                                    <c:out value="${info.sname}"/>
                                </td>
                            </tr>
                            <tr>

                                <td>
                                    <spring:message code="field.tname"/>
                                </td>
                                <td>
                                    <c:out value="${info.tname}"/>
                                </td>
                            </tr>

                            <tr>

                                <td>
                                    <spring:message code="field.group"/>
                                </td>
                                <td>
                                    <c:out value="${info.group.name}"/>
                                </td>
                            </tr>
                            <tr>

                            <tr>

                                <td>
                                    <spring:message code="field.rate"/>
                                </td>
                                <td>


                                    <form action="<c:out value="${info.id}"/>" method="POST">

                                        <c:out value="${info.rate}"/>


                                        <c:if test="${vote==0}">


                                        <input type="hidden" value="+1" name="rate">
                                        <button type="submit"><spring:message code="button.giveVote"/></button>
                                    </form>


                                    </c:if>

                                    <c:if test="${vote==1}">


                                        <input type="hidden" value="-1" name="rate">
                                        <button type="submit"><spring:message code="button.takeOutVote"/></button>


                                    </c:if>


                                </td>
                            </tr>


                            <tr>

                        </table>


                    </td>
                </tr>
            </table>


            <div class="updown">
                <h3 class="active">
                    <spring:message code="label.groupmates"/>
                </h3>

                <table>


                    <c:forEach items="${groupmates}" var="gr" varStatus="status">
                        <c:if test="${status.index mod 4==0}">

                            <tr>
                        </c:if>

                        <td>
                            <img height="40" src="<c:url value="/userimg/"/><c:out value="${gr.imgurl}"/>"
                                 alt="">
                        </td>


                        <td>
                            <a href="user/<c:out value="${gr.id}"/>">
                                <c:out value="${gr.fname}"/>
                                <br>
                                <c:out value="${gr.sname}"/>
                            </a>

                        </td>
                        <c:if test="${status.index+3 mod 4==0}">

                            </tr>
                        </c:if>

                    </c:forEach>

                </table>

            </div>


        </td>
    </tr>

    <tr>
        <td>
            <%@include file="/WEB-INF/inc/footer.jsp" %>
        </td>
    </tr>

</table>

</body>
</html>